package com.laima.basic.service.impl;

import com.laima.basic.dao.SysNoticeMapper;
import com.laima.basic.model.SysNotice;
import com.laima.basic.service.SysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: backend-server
 * @description: 通知公告
 * @author: T
 * @create: 2021-03-25 10:10
 **/
@Service
public class SysNoticeServiceImpl implements SysNoticeService {

    @Autowired
       private SysNoticeMapper sysNoticeMapper;

    /**
     * 查询公告信息
     *
     * @param noticeId 公告ID
     */
    @Override
    public SysNotice selectNoticeById(Long noticeId) {
        return sysNoticeMapper.selectNoticeById(noticeId);
    }

    /**
     * 查询公告列表
     *
     * @param notice 公告信息
     */
    @Override
    public List<SysNotice> selectNoticeList(SysNotice notice) {
        return sysNoticeMapper.selectNoticeList(notice);
    }

    /**
     * 新增公告
     *
     * @param notice 公告信息
     */
    @Override
    public int insertNotice(SysNotice notice) {
        return sysNoticeMapper.insertNotice(notice);
    }

    /**
     * 修改公告
     *
     * @param notice 公告信息
     */
    @Override
    public int updateNotice(SysNotice notice) {
        return sysNoticeMapper.updateNotice(notice);
    }

    /**
     * 批量删除公告
     *
     * @param noticeId 公告ID
     */
    @Override
    public int deleteNoticeById(Long noticeId) {
        return sysNoticeMapper.deleteNoticeById(noticeId);
    }

    /**
     * 批量删除公告信息
     *
     * @param noticeIds
     */
    @Override
    public int deleteNoticeByIds(Long[] noticeIds) {
        return sysNoticeMapper.deleteNoticeByIds(noticeIds);
    }
}
